<template>
  <component :is="componentName" :reportData="reportData" @close="$emit('close')"></component>
</template>

<script>
import ReportDatabase from './components/ReportDatabase'
import ReportClientIp from './components/ReportClientIp'
import ReportSensitiveLevel from './components/ReportSensitiveLevel'
import ReportTable from './components/ReportTable'
import ReportSensitiveType from './components/ReportSensitiveType'
import ReportSensitiveLabel from './components/ReportSensitiveLabel'
import ReportSensitiveWord from './components/ReportSensitiveWord'

export default {
  name: 'Report',
  components: {
    ReportDatabase,
    ReportTable,
    ReportSensitiveLevel,
    ReportSensitiveType,
    ReportClientIp,
    ReportSensitiveLabel,
    ReportSensitiveWord
  },
  computed: {
    componentName: function() {
      return `report-${this.type}`
    }
  },
  props: {
    type: {
      type: String
    },
    reportData: {
      type: Object,
      default: () => ({})
    }
  }
}
</script>
